﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Decoration.Models.Models
{
    /// <summary>
    /// 工序分配表
    /// </summary>
    public class UserProcedure
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [ForeignKey(nameof(ProjectId))]
        public int ProjectId { get; set; }

        /// <summary>
        /// 工序名称
        /// </summary>
        [MaxLength(50)]
        public string ProcedureName { get; set; } = null!;

        /// <summary>
        /// 工序负责人
        /// </summary>
        public int Employee { get; set; }

        [MaxLength(50)]
        public string EmployeeName { get; set; } = null!;

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateOnly BeginDate { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateOnly EndDate { get; set; }

        /// <summary>
        /// 注意事项
        /// </summary>
        [MaxLength(500)]
        public string? Desc { get; set; }

        /// <summary>
        /// 工序序号
        /// </summary>
        public int ProcedureOrder { get; set; }

        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 验收状态 1 - 未验收 2 - 通过 3 - 未通过
        /// </summary>
        public int CheckStatus { get; set; } = 1;

        /// <summary>
        /// 1 - 进行中 2 - 已完成 3 - 延期
        /// </summary>
        public int Status { get; set; } = 1;

        public virtual ProjectInfo? Project { get; set; }
    }
}
